package db

import "gorm.io/gorm"

var PQ_HOST = "localhost"
var PQ_PORT = "5432"

var INFLUXDB_HOST = "http://127.0.0.1"
var INFLUXDB_PORT = "8086"
var INFLUXDB_USERNAME = "admin"
var INFLUXDB_PASSWORD = "family"
var INFLUXDB_DATABASE = "iot"
var INFLUXDB_TOCKEN = "WBpGO5q0rLxtV7iViRwaNSlbweLPmgngadR8yKY8qXU4QYYrnWmiDKYXbYqiAZX5TaKOXsvG_yRbf7ZX2mkbTg=="
var INFLUXDB_ORG = "family"

type DeviceBasics struct {
	gorm.Model
	Name     string `gorm:"column:name;type:varchar(50);" json:"dev_name"`
	ParaType string `gorm:"column:para_type;type:varchar(50);" json:"para_type"`
	Data     string `gorm:"column:data;type:varchar(8192);" json:"data ,optional"`
}

type DataVal struct {
	Name string  `json:"name"`
	Key  string  `json:"key"`
	Val  float32 `json:"val"`
}

type DataInfo struct {
	DataList []DataVal
}

type Power struct {
	gorm.Model
	Power float32 `gorm:"column:power;type:real;" json:"power ,optional"`
}

type GridPower struct {
	Power
}

type BmsPower struct {
	Power
}
